home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.direct.ca!usenet
- From: qjackson@direct.ca
- Newsgroups: comp.lang.c++
- Subject: Re: class defined after use?
- Date: Fri, 19 Jan 1996 18:19:58 GMT
- Organization: Parsepolis Software
- Message-ID: <4don9o$qk1@grid.direct.ca>
- References: <4d4l4a$ecg@news1.wolfe.net>
- Reply-To: qjackson@direct.ca
- NNTP-Posting-Host: 204.174.249.47
- X-Newsreader: Forte Free Agent 1.0.82
-
- mgooding@wolfe.net (Joshua Gooding) wrote:
-
- >Is it possible to have a class with a pointer to a variable of another
- >type that is defined later int he file?
-
- Yes. If the member data is only a **pointer** to the class, you can
- forward declare a class thus:
-
- class myClass;
-
- As in:
-
- class forwardFoo;
-
- class fooClass
- {
- //someFoo
- forwardFoo* Baz; // forwardFoo baz; would be illegal here
- //someBar
- };
-
- [... reams of code ...]
-
- class forwardFoo
- {
- //yetMoreFooBar
- };
-
-
- Cheers,
-
-
-
-
- -- \|/ O |
- --+-- Parsepolis Software -*- --|-- Quinn Tyler Jackson
- /|\ "Parse City" /^\ | (aka 'Jamshid')
- >-----------------------------------------------| qjackson@direct.ca
- Ask me about Laleh's Pattern Matcher... |--------------------->
-
-